package rmi.bank;

import java.net.MalformedURLException;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

public class Main
{
	public static void main(String args[])
	{
		try
		{
			if (args.length >= 2)
			{
				if (args[0].equals("client"))
				{
					new BankAccountClient(args[1]);
				}
				else if (args[0].equals("server"))
				{
					new BankAccountServer(args[1]);
				}
				else
					System.out.println("Arguments doesn't match anything!");
			}
			else
				System.out.println("To few arguments");
		}
		catch (RemoteException e)
		{
			e.printStackTrace();
		}
		catch (MalformedURLException e)
		{
			e.printStackTrace();
		}
		catch (NotBoundException e)
		{
			e.printStackTrace();
		}
	}
}
